#! /bin/sh

name=freeglut
version=3.6.0
revision=1
tarball_url="https://github.com/freeglut/freeglut/releases/download/v${version}/freeglut-${version}.tar.gz"
tarball_blake2b="c42985013aafbe0e21369295f67355f2b498f284289fceed9baff5de6a46b7fee2a2ee07e00c136f65caa9159b635df82030a112eae101f9f82751abd76636e4"
imagedeps="cmake ninja-build git"
hostdeps="gcc pkg-config"
deps="core-libs libxi mesa glu"

configure() {
        CFLAGS="$TARGET_CFLAGS -std=gnu17" \
        CXXFLAGS="$TARGET_CXXFLAGS" \
        LDFLAGS="$TARGET_LDFLAGS" \
    cmake_configure_noflags \
        -DFREEGLUT_BUILD_DEMOS=OFF \
        -DFREEGLUT_BUILD_STATIC_LIBS=OFF
}

build() {
    ninja -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" ninja install

    post_package_strip
}
